<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>盒子模型的问题</title>
</head>
<style>
    /* #box1 {
        width: 200px;
        height: 200px;
        background: red;
        margin-bottom: 30px;
    }

    #box2 {
        width: 200px;
        height: 200px;
        background: blue;
        margin-top: 30px;
    } */

    /*解决方案1:加边框解决问题 */
    /* #box1 {
        width: 200px;
        height: 200px;
        background: red;
        border: black 1px solid;
    }

    #box2 {
        width: 100px;
        height: 100px;
        background: blue;
        margin-top: 100px;
    } */

    /*解决方案2: padding-top: 100px eight: 100px; */
    #box1 {
        width: 100%;
        height: 200%;
        background: red;
        border: solid 1px blueviolet;


    }

    #box2 {
        width: 100%;
        height: 100%;
        background: blue;
        margin-top: 30px;
    }
</style>

<body>
    <!-- <div id="box1">
        <div id="box2"></div>
    </div> -->
    <span id="box1">
        第1个
        <span id="box2">第2个</span>
    </span>
</body>

</html>